/////////////////////////////////////////////
// ObjectARX defined commands

#include "StdAfx.h"
#include "StdArx.h"


// This is command 'TSS'
void tss()
{
	int i	;			// Row of ads_matrix
	ads_matrix xform;	// The transformation matrix
	ads_name ssGrp;		// The entities that make up transform SS
	int rc;				// Return code
	ads_real sf;		// Scale Factor


	// Select the entities
	acedPrompt("\nSelect enties to scale (transfrom) ");
	rc = acedSSGet(NULL, NULL, NULL, NULL, ssGrp);
	if(rc != RTNORM)
	{
		acutPrintf("\nEmpty or invalid selection set ");
		return;
	}

	// Input the scale factor
	acedInitGet(RSG_NONULL + RSG_NONEG + RSG_NOZERO, NULL);
	acedGetReal("\nTransformation Scale factor: ", &sf);

	// Initialize the matrix
	ident_init(xform);

	// Apply the scaling factor
	// to the matrix
	for(i = 0; i <= 3; i++)
	{
		xform[i][i] = sf;
	}
	
	rc = acedXformSS(ssGrp, xform);
	if(rc != RTNORM)
	{
		acutPrintf("\nFailed in transformation of selection set. ");
	}

	acedSSFree(ssGrp);	
}

